From 74bc8d699de9bcc46f11d662a5b3537961fabc83 Mon Sep 17 00:00:00 2001 From: tsteven4 Date: Wed, 14 Nov 2018 09:41:06 -0700 Subject: [PATCH] add msvc2017 builds to appveyor. (#270) --- appveyor.yml | 73 ++++++++++------------------------ tools/make_windows_release.ps1 | 72 ++++++++++++++++++++++----------- 2 files changed, 69 insertions(+), 76 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 24d6043b7..4f8577bf4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,78 +2,47 @@ version: 1.0.{build} environment: matrix: - # MinGW gui builds fail with Qt newer than 5.6 as webkit and webengine are missing. - # MinGW - # - name: win32 - # platform: mingw - # qt: 5.5\mingw492_32 - # tools: mingw492_32 - # MinGW - # - name: win32 - # platform: mingw - # qt: 5.6\mingw49_32 - # tools: mingw492_32 - # do a build with the minimum level of Qt we support. - # appveyor dropped Qt 5.7 with msvc2015. - # MSVC x32 - # - name: win32 - # platform: x86 - # qt: 5.7\msvc2015 - # MSVC x32 - - name: win32 - platform: x86 + - arch: x86 qt: 5.9\msvc2015 - # MSVC x64 - - name: win64 - platform: amd64 + flow: nmake + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + - arch: amd64 qt: 5.9\msvc2015_64 + flow: nmake + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + - arch: x86_amd64 + qt: 5.9\msvc2017_64 + flow: nmake + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + - arch: x86_amd64 + qt: 5.9\msvc2017_64 + flow: msbuild + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 init: - - if %platform%==mingw set PATH=%PATH:C:\Program Files\Git\usr\bin;=% - - if %platform%==mingw set PATH=C:\Qt\Tools\%tools%\bin;%PATH% - set PATH=C:\Qt\%qt%\bin;%PATH% - - if not %platform%==mingw call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %platform% + - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %arch% + - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" %arch% build_script: - ps: | # be aware that vcvarsall will reset platform amd64 to X64! - echo "platform: $env:platform" + echo "arch: $env:arch" echo "qt: $env:qt" qmake -query Get-Location - if (($env:platform -eq "mingw") -and ($env:qt -eq "5.5\mingw492_32")) - { - # windeployqt in 5.5.1 suffers from bug - # https://bugreports.qt.io/browser/QTBUG-48946 - # which trashes the translations. Work around - # by using the next version of windeployqt which had this - # bug fixed. - & ".\tools\make_windows_release.ps1" -windeployqt "C:\Qt\5.6\mingw49_32\bin\windeployqt.exe" - $verid=(Get-Date -UFormat "%Y%m%dT%H%MZ" -Date (Get-Date -Date (git show -s --format="%aI" HEAD)).toUniversalTime()) ` - + '-' + (git rev-parse --short=7 HEAD) - Get-ChildItem .\gui\release\GPSBabel-*-Setup.exe | % { Push-AppveyorArtifact $_.FullName -FileName "GPSBabel-$($verid)-Setup.exe" } - Get-ChildItem .\gui\release\GPSBabel-*-Manifest.txt | % { Push-AppveyorArtifact $_.FullName -FileName "GPSBabel-$($verid)-Manifest.txt" } - } - elseif (($env:platform -eq "x86") -and ($env:qt -eq "5.9\msvc2015")) + if (($env:arch -eq "x86") -and ($env:qt -eq "5.9\msvc2015")) { # full build and deploy of our release configuration - & ".\tools\make_windows_release.ps1" -gpsbabel_build_dir_name "build-GPSBabel-Desktop_Qt_5_9_MSVC2015_32bit-Release" -gui_build_dir_name "build-app-Desktop_Qt_5_9_MSVC2015_32bit-Release" -mkspec win32-msvc -mkcmd nmake.exe + & ".\tools\make_windows_release.ps1" -gpsbabel_build_dir_name "build-GPSBabel-Desktop_Qt_5_9_MSVC2015_32bit-Release" -gui_build_dir_name "build-app-Desktop_Qt_5_9_MSVC2015_32bit-Release" -flow $env:flow -buildinstaller "true" $verid=(Get-Date -UFormat "%Y%m%dT%H%MZ" -Date (Get-Date -Date (git show -s --format="%aI" HEAD)).toUniversalTime()) ` + '-' + (git rev-parse --short=7 HEAD) Get-ChildItem .\gui\release\GPSBabel-*-Setup.exe | % { Push-AppveyorArtifact $_.FullName -FileName "GPSBabel-$($verid)-Setup.exe" } Get-ChildItem .\gui\release\GPSBabel-*-Manifest.txt | % { Push-AppveyorArtifact $_.FullName -FileName "GPSBabel-$($verid)-Manifest.txt" } } - elseif ($env:platform -eq "mingw") - { - qmake GPSBabel.pro - mingw32-make - if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } - } else { - qmake GPSBabel.pro - nmake - if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } + & ".\tools\make_windows_release.ps1" -flow $env:flow } # work around issue with standard error output causing a build failure by making sure last command succeeds. # see https://help.appveyor.com/discussions/problems/10014-false-build-fail-status @@ -96,7 +65,7 @@ deploy_script: - ps: | $env:projdir=(C:\msys64\usr\bin\bash.exe -c "pwd") C:\msys64\usr\bin\bash.exe -lc "cd $env:projdir; ./tools/ci_tokens" - if (($env:platform -eq "x86") -and ($env:qt -eq "5.9\msvc2015") -and ($env:APPVEYOR_REPO_BRANCH -eq "master")) + if (($env:arch -eq "x86") -and ($env:qt -eq "5.9\msvc2015") -and ($env:APPVEYOR_REPO_BRANCH -eq "master")) { $verid=(Get-Date -UFormat "%Y%m%dT%H%MZ" -Date (Get-Date -Date (git show -s --format="%aI" HEAD)).toUniversalTime()) ` + '-' + (git rev-parse --short=7 HEAD) diff --git a/tools/make_windows_release.ps1 b/tools/make_windows_release.ps1 index 6b18dfbcc..fc61ece79 100755 --- a/tools/make_windows_release.ps1 +++ b/tools/make_windows_release.ps1 @@ -3,9 +3,9 @@ # Run this from a Qt Desktop command window that has the Qt and mingw compiler paths set up, # such as the one Qt Creator will put on the start menu. # For example, to run overriding the default locations of windeployqt and ISSC: -# powershell.exe -ExecutionPolicy Unrestricted -File tools\make_windows_release.ps1 -windeployqt "C:\Qt\5.6.3\mingw49_32\bin\windeployqt.exe" -iscc "C:\Program Files (x86)\Inno Setup 5\ISCC.exe" +# powershell.exe -ExecutionPolicy Unrestricted -File tools\make_windows_release.ps1 -windeployqt "C:\Qt\5.6.3\mingw49_32\bin\windeployqt.exe" -iscc "C:\Program Files (x86)\Inno Setup 5\ISCC.exe" -flow mingw # Or to do a 64 bit MSVC build with a newer Qt: -# powershell.exe -ExecutionPolicy Unrestricted -File tools\make_windows_release.ps1 -iscc "C:\Program Files (x86)\Inno Setup 5\ISCC.exe" -gpsbabel_build_dir_name "build-GPSBabel-Desktop_Qt_5_9_3_MSVC2015_64bit-Release" -gui_build_dir_name "build-app-Desktop_Qt_5_9_3_MSVC2015_64bit-Release" -mkspec win32-msvc -mkcmd nmake.exe +# powershell.exe -ExecutionPolicy Unrestricted -File tools\make_windows_release.ps1 -iscc "C:\Program Files (x86)\Inno Setup 5\ISCC.exe" -gpsbabel_build_dir_name "build-GPSBabel-Desktop_Qt_5_9_3_MSVC2015_64bit-Release" -gui_build_dir_name "build-app-Desktop_Qt_5_9_3_MSVC2015_64bit-Release" # # Be aware this script is used by appveyor.yml # @@ -13,46 +13,70 @@ Param( $windeployqt = "windeployqt.exe", $iscc = "C:\Program Files (x86)\Inno Setup 5\ISCC.exe", - $gpsbabel_build_dir_name = "build-GPSBabel-Desktop_Qt_5_5_1_MinGW_32bit-Release", - $gui_build_dir_name = "build-app-Desktop_Qt_5_5_1_MinGW_32bit-Release", - $mkspec = "win32-g++", - $mkcmd = "mingw32-make" + $gpsbabel_build_dir_name = "build-GPSBabel-Desktop-Release", + $gui_build_dir_name = "build-app-Desktop-Release", + $flow = "nmake", + $buildinstaller = "false" ) +$ErrorActionPreference = "Stop" # verify we are in the top of the gpsbabel clone -Get-Item tools/make_windows_release.ps1 -ErrorAction Stop +Get-Item tools/make_windows_release.ps1 -ErrorAction Stop | Out-Null $gpsbabel_src_dir = "$Pwd" $gpsbabel_build_dir = "$($gpsbabel_src_dir)\..\$($gpsbabel_build_dir_name)" $gui_build_dir = "$($gpsbabel_src_dir)\$($gui_build_dir_name)" # mimic creator shadow build to match Inno setup file # make sure we are staring with a clean build directory Remove-Item "$($gpsbabel_build_dir)" -Recurse -ErrorAction Ignore -New-Item "$($gpsbabel_build_dir)" -type directory -force +New-Item "$($gpsbabel_build_dir)" -type directory -force | Out-Null Set-Location "$($gpsbabel_build_dir)" -qmake "$($gpsbabel_src_dir)\GPSBabel.pro" -spec "$($mkspec)" -if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } -& "$($mkcmd)" qmake_all -& "$($mkcmd)" -if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } +switch ($flow) { + "mingw" { qmake "$($gpsbabel_src_dir)\GPSBabel.pro" -spec "win32-g++" } + "msbuild" { qmake -tp vc "$($gpsbabel_src_dir)\GPSBabel.pro"} + "nmake" { qmake "$($gpsbabel_src_dir)\GPSBabel.pro" -spec "win32-msvc" } +} +if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } +switch ($flow) { + "mingw" { ming32-make } + "msbuild" { msbuild GPSBabel.vcxproj -property:Configuration=Release } + "nmake" { nmake /NOLOGO } +} +if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } # copy GPSBabel.exe for use by test_script Remove-Item "$($gpsbabel_src_dir)\release" -Recurse -ErrorAction Ignore -New-Item "$($gpsbabel_src_dir)\release" -type directory -force +New-Item "$($gpsbabel_src_dir)\release" -type directory -force | Out-Null Copy-Item release\GPSBabel.exe "$($gpsbabel_src_dir)\release\GPSBabel.exe" Set-Location "$($gpsbabel_src_dir)" # make sure we are staring with a clean build directory Remove-Item "$($gui_build_dir)" -Recurse -ErrorAction Ignore -New-Item "$($gui_build_dir)" -type directory -force +New-Item "$($gui_build_dir)" -type directory -force | Out-Null Set-Location "$($gui_build_dir)" -qmake "$($gpsbabel_src_dir)\gui\app.pro" -spec "$($mkspec)" -if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } -& "$($mkcmd)" qmake_all -& "$($mkcmd)" -if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } +switch ($flow) { + "mingw" { qmake "$($gpsbabel_src_dir)\gui\app.pro" -spec "win32-g++" } + "msbuild" { qmake -tp vc "$($gpsbabel_src_dir)\gui\app.pro"} + "nmake" { qmake "$($gpsbabel_src_dir)\gui\app.pro" -spec "win32-msvc" } +} +if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } +switch ($flow) { + "mingw" { ming32-make } + "msbuild" { msbuild GPSBabelFE.vcxproj -property:Configuration=Release } + "nmake" { nmake /NOLOGO } +} +if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } +# work around errors with lupdate, lrelease misprocessing qtHaveModule(webenginewidgets) +# and generating a message to stderr WARNING: Project ERROR: Unknown module(s) in QT: webkit webkitwidgets +# and, on Windows, setting $? to false. +# (assuming they are not installed). +$ErrorActionPreference = "Continue" lupdate "$($gpsbabel_src_dir)\gui\app.pro" lrelease "$($gpsbabel_src_dir)\gui\app.pro" +$ErrorActionPreference = "Stop" # use --plugindir option to locate the plugins. & "$($windeployqt)" --verbose 10 --plugindir release\plugins release\GPSBabelFE.exe -if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } -Set-Location "$($gpsbabel_src_dir)\gui" -& "$($iscc)" /Dgpsbabel_build_dir_name="$($gpsbabel_build_dir_name)" /Dgui_build_dir_name="$($gui_build_dir_name)" setup.iss -if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } +if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } +if ($buildinstaller -eq "true") +{ + Set-Location "$($gpsbabel_src_dir)\gui" + & "$($iscc)" /Dgpsbabel_build_dir_name="$($gpsbabel_build_dir_name)" /Dgui_build_dir_name="$($gui_build_dir_name)" setup.iss + if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } +} Set-Location "$($gpsbabel_src_dir)" -- 2.30.2